package com.li.springbootproject.mapper;

import java.util.List;

import com.li.springbootproject.domain.test.OrgTempDO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 8/5/2022 3:42 PM
 */
@Mapper
public interface OrgTempMapper  {

    @Insert("<script>INSERT INTO orgtemp\n" +
            "        (id,request_id,code,type)\n" +
            "        values\n" +
            "        <foreach collection=\"extInfo.list\" item=\"item\" separator=\",\">\n" +
            "            (#{item.id}, #{item.requestId}, #{item.code}, #{item.type})\n" +
            "        </foreach></script>")
    int insertBatch(OrgTempDO orgTempDO);

    @Insert("<script>INSERT INTO orgtemp\n" +
            "        (id,request_id,code,type)\n" +
            "        values\n" +
            "        <foreach collection=\"orgTempList\" item=\"item\" separator=\",\">\n" +
            "            (#{item.id}, #{item.requestId}, #{item.code}, #{item.type})\n" +
            "        </foreach></script>")
    void insertBatchOrgTemp(List<OrgTempDO> orgTempList);

}
